<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<!DOCTYPE html>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<html>
<base href="<%=basePath%>">
<head lang="en">
<meta charset="UTF-8">
<title></title>
<script type="text/javascript" src="js/jquery-1.42.min.js"></script>
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript" src="js/bootstrap.min.js" ></script>
<script type="text/javascript" src="js/countUp.js" ></script>
<script type="text/javascript" src="js/dialog.js"></script>

<link rel="stylesheet" href="css/bootstrap.min.css" />
<link rel="stylesheet" href="css/dashboard.css" />
<link rel="stylesheet" href="css/headbott.css" type="text/css" />
<link rel="stylesheet" href="css/bootstrap.min.css" />
<link rel="stylesheet" href="css/dashboard.css" />
<link rel="stylesheet" href="css/user.css" />
<link rel="stylesheet" href="css/dialog.css" />

</head>

<body>
	<div id="header">
		<div class="heade-con">
			<div class="logo">
				<a href=""><img src="images/LOGO.png" /></a>
			</div>
			<div class="nav posa">
				<ul>
					<li><a class="vcolor" href="index.do">首页</a></li>
					<li><a href="project/queryByType.do">公益众筹</a></li>
					<li><a href="problem/queryAll.do">常见问题</a></li>
					<li><a href="ly-list.do">众筹资讯</a></li>
					<li><a href="new_info.do" style="">发布项目</a></li>
				</ul>
			</div>
			<div class="search">
				<form action="">
					<input type="text" class="search-txt" value="找项目"> <input
						type="submit" class="search-but" value="">
				</form>
			</div>
			<div class="index-login">
				<c:choose>
					<c:when test="${login_user!=null }">
						<a href="project/queryByUsId.do">${login_user.usAccount }</a>
						<a href="user/quit.do">退出</a>
					</c:when>
					<c:otherwise>
						<a href="login.do">登录</a>
						<span style="color: white;">|</span>
						<a href="reg.do">注册</a>
					</c:otherwise>
				</c:choose>

			</div>
		</div>
	</div>
	<script>
		var d_var = $(".search .search-txt").val();
		$(".search .search-txt").focus(function() {
			if ($(this).val() == d_var) {
				$(this).val("");
			}
		});

		$(".search .search-txt").blur(function() {
			if ($(this).val() == "") {
				$(this).val("找项目");
			}
		});
	</script>
	<div class="user-con">
		<div class="user-conl">
			<ul>
				<li><b class="a-tit">项目管理</b></li>
				<li><i class="i1"></i><a 
					href="project/queryByUsId.do">发起的项目</a></li>
				<li><i class="i2"></i><a href="project/queryFunPro.do">参与的项目</a></li>
				<li><i class="i4"></i><a href="project/queryLikePro.do">点赞的项目</a></li>
				<li><i class="i6"></i><a href="javascript:void(0)">资金管理</a></li>
				<li><b class="a-tit">消息管理</b></li>
				<li><i class="i4"></i><a href="com/queryByUsId.do">我的评论</a></li>
				<li><i class="i4"></i><a class="u-hover" href="let/queryByUsId.do">我的私信</a></li>
				<li><b class="a-tit">个人设置</b></li>
				<li><i class="i7"></i><a href="user_data.do">资料修改</a></li>
				<li><i class="i8"></i><a href="user_address.do">收件地址管理</a></li>
				<li><i class="i9"></i><a href="user_realName.do">实名认证</a></li>
			</ul>
		</div>
		<div class="user-conr">
			<div class="user-conr_tab">
				<ul>
					<li class="cur">未读私信</li>
					<li>所有私信</li>
				</ul>
			</div>
			<div class="user-conr_tab2">
				<ul>
					<li class="curq2">
						<div class="panel-body">

							<div class="table-responsive ">
								<table id="let_table1" class="table table-striped table-bordered">
									<thead>
										<tr>
											<th>发件人</th>
											<th>发件时间 </th>
											<th>内容</th>
											<th colspan="2">操作</th>
										</tr>
									</thead>
									<tbody>
										<c:forEach items="${p2.list }" var="letter">
											<tr id = "aa${letter.leId }" >
												<td>${letter.usName }</td>
												<td><fmt:formatDate value="${letter.leTime }"
														pattern="yy-MM-dd" /></td>
												<td title="${letter.leContent }">
												<c:if test="${fn:length(letter.leContent)>'8'}">
													${fn:substring(letter.leContent,0,8)}...
												</c:if>
												<c:if test="${fn:length(letter.leContent)<='8'}">
														${letter.leContent}
												</c:if>
												</td>
												<td><a href="#" data-toggle="modal"
                                       data-target="#myModal"  onclick="readLet(${letter.leId },'${letter.leContent}','aa${letter.leId }')"
												>查看详情</a></td>
												<td><a href = "let/deleteLet.do?le_id=${letter.leId }">删除</a></td>
												
											</tr>
										</c:forEach>

									</tbody>
								</table>
							</div>
							<a href = "let/queryByUsId.do?tr2=${p2.prePage }">上一页</a>  ${p2.pageNum }/${p2.pages }页  
					<c:if test="${p2.pageNum<p2.pages }">	<a href = "let/queryByUsId.do?tr2=${p2.nextPage }">下一页</a></c:if>
						</div>
							<!--模态框-->
                    <div class="modal fade" id="myModal" tabindex="-1" role="dialog"
                         aria-labelledby="myModalLabel" aria-hidden="true">
                        <div class="modal-dialog">
                            <div class="modal-content">
                                <div class="modal-header">
                                    <button type="button" class="close" data-dismiss="modal"
                                            aria-hidden="true">&times;</button>
                                    <h4 class="modal-title" id="myModalLabel">信件详细内容（点击其它地方关闭）</h4>
                                </div>
                                <div class="modal-body">
                                    <div class="form">
                                        <form class="form-validate form-horizontal" id="feedback_form"
                                              method="post">
                                            <span id = "letter_info"></span>
                                            <div class="form-group" style="text-align: right;">
                                                <div class="col-lg-offset-2 col-lg-10">
                                                </div>
                                            </div>
                                        </form>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
							
							


					</li>
					<li >
						<div class="panel-body">
							<div class="table-responsive ">
								<table class="table table-striped table-bordered">
									<thead>
										<tr >
											<th>发件人</th>
											<th>发件时间 </th>
											<th>内容</th>
											<th>是否已读</th>
											<th>操作</th>
										</tr>
									</thead>
									<tbody>
										<c:forEach items="${p1.list }" var="letter">
											<tr>
												<td>${letter.usName }</td>
												<td><fmt:formatDate value="${letter.leTime }"
														pattern="yy-MM-dd" /></td>
												<td>${letter.leContent }</td>
												<th>
													<c:choose>
														<c:when test="${letter.leStastu == 1 }">已读</c:when>
														<c:otherwise>未读</c:otherwise>
													</c:choose>
												</th>
												<td><a href = "let/deleteLet.do?le_id=${letter.leId }">删除</a></td>
											</tr>
										</c:forEach>
									</tbody>
								</table>
							</div>
							
							<a href = "let/queryByUsId.do?tr1=${p1.prePage }">上一页</a>  ${p1.pageNum }/${p1.pages }页  
					<c:if test="${p1.pageNum<p1.pages }">	<a href = "let/queryByUsId.do?tr1=${p1.nextPage }">下一页</a></c:if>
							
						</div>
					</li>
				</ul>
			</div>
		</div>
		<script>
			$(document).ready(
					function() {
						$(".user-conr_tab li").click(
								function() {
									$(".user-conr_tab li").eq($(this).index())
											.addClass("cur").siblings()
											.removeClass('cur');
									$(".user-conr_tab2 li").hide().eq(
											$(this).index()).show();
								})
					});
		</script>
	</div>
	<div id="bottom">
		<div class="bot-con1">
			<ul>
				<li class="bot-con1-li1">我们已经做到</li>
				<li>单项支持人数<span class="inde-span1"></span></li>
				<li>单项筹款金额<span class="inde-span2"></span></li>
				<li>累计筹款金额<span class="inde-span3"></span></li>
			</ul>
		</div>
		<div class="bot-con1 bot-con2">
			<ul>
				<li class="bot-con1-li1">发起项目流程</li>
				<li><span class="inde-span4"></span>发起人创建项目</li>
				<li><span class="inde-span5"></span>项目获得支持</li>
				<li><span class="inde-span6"></span>发起人发放回报</li>
				<li><span class="inde-span7"></span>用户收到回报</li>
			</ul>
		</div>
		<div class="bottom-ggt">
			<a href=""><img src="images/bottbom_68.jpg" alt="" /></a>
		</div>
		<div class="zc-yqlink">
			<ul>
				<li><a href="">阿里巴巴集团</a></li>
				<li><a href="">淘宝网</a></li>
				<li><a href="">天猫</a></li>
				<li><a href="">聚划算</a></li>
				<li><a href="">全球速卖通</a></li>
				<li><a href="">阿里巴巴国际交易市场</a></li>
				<li><a href="">1688</a></li>
				<li><a href="">阿里妈妈</a></li>
				<li><a href="">阿里旅行</a></li>
				<li><a href="">阿里云计算</a></li>
				<li><a href="">阿里巴巴集团</a></li>
				<li><a href="">淘宝网</a></li>
				<li><a href="">天猫</a></li>
				<li><a href="">聚划算</a></li>
				<li><a href="">全球速卖通</a></li>
				<li><a href="">阿里巴巴国际交易市场</a></li>
				<li><a href="">1688</a></li>
				<li><a href="">阿里妈妈</a></li>
				<li><a href="">阿里云计算</a></li>
			</ul>
		</div>
		<div class="footer-bd">

			<a href=" ">关于淘宝</a> <a href=" ">合作伙伴</a> <a href=" ">营销中心</a> <a
				href=" ">廉正举报</a> <a href=" ">联系客服</a> <a href=" ">开放平台</a> <a
				href=" ">诚征英才</a> <a href=" ">联系我们</a> <a href=" ">网站地图</a> <a
				href=" ">法律声明</a> <em>© 2003-2015 Taobao.com 版权所有</em><br> <br>
			<span>网络文化经营许可证：<a href=" ">浙网文[2013]0268-027号</a></span> <b>|</b> <span
				data-spm-protocol="i">增值电信业务经营许可证：<a href="">浙B2-20080224-1</a></span>
			<b>|</b> <span>信息网络传播视听节目许可证：1109364号</span> <b>|</b> <span>举报电话:0571-81683755</span>
		</div>
	</div>
	
	
<script type="text/javascript">
	
	function readLet(id,letter,aaid){
		
		document.getElementById("letter_info").innerHTML=letter;
		$.ajax({
	  		url:"let/readLet.do",
	  		type:"post",
	  		data:{"leId":id},
	  		success:function(){
	  			var a =document.getElementById(aaid).rowIndex;
	  			document.getElementById("let_table1").deleteRow(a);
	  			
	  		}
	  	})
		
	 }
	  	
	  	
	  	
	  	
</script>
</body>
</html>